-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make CMD+Enter work for single-selection pages #9672
Conversation
|
this.props.onConfirmSelection(focusedOption); | ||
if (!focusedOption) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be above the first check since the code inside that block is also using the focusedOption
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving this up as you've suggested breaks things, because it prevents CMD+Enter
from creating a group chat if there are participants selected and the search bar is highlighted. But as it turns out, onConfirmSelection
doesn't really need the focusedOption
and that's not really it's intended use. I did an audit of all of it's usages:
- here it's only ever triggered for group chats, and
createGroup
takes no arguments. So I clarified that and replaced the 1:1createChat
method with a noop. - here invite user takes no arguments
- here
finalizeParticipants
takes no arguments. - here
confirm
take an argument that's only used by thesendMoney
flow. And in thesendMoney
flowonConfirmSelection
is never called. I looked into splittingconfirm
intoconfirmSend
andconfirmRequest
, but it feels out-of-scope and everything seems to be working as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good eye though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok cool.
@marcaaron looks like this was merged without passing tests. Please add a note explaining why this was done and remove the |
Make CMD+Enter work for single-selection pages (cherry picked from commit 7c2c5db)
…9672 🍒 Cherry pick PR #9672 to staging 🍒
🚀 Deployed to production by @roryabraham in version: 1.1.79-17 🚀
|
Details
This makes
CMD+Enter
work just likeEnter
onOptionsSelector
components that support only a single selection instead of multiple selections.Fixed Issues
$ #9594
Tests / QA Steps
Repeat the QA steps for #7702. On any pages where only a single selection is possible, replace
Enter
withCMD+Enter
and everything should work as expected.PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)PR Reviewer Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followed/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)